<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
    <title>数据管理</title>
  </head>
  <body>
    <script type="text/javascript">
      Ext.onReady(function(){
        var clearTestDataButton = new Ext.Button({
          text: '    清空测试数据    ',
          handler: function(){
            Ext.MessageBox.confirm("提示","你确认要清空所有数据吗？",function(btn){
              if(btn=="yes"){
                Ext.Ajax.request({
                  url : '/admin/clearTestData',
                  timeout: 120000,
                  success : function (result, request) {
                    Ext.Msg.alert('提示信息','数据已经完全清空');
                  },
                  failure : function (result, request){
                    Ext.MessageBox.show({
                      title: '消息',
                      msg: "通讯失败，请从新操作",
                      buttons: Ext.MessageBox.OK,
                      icon: Ext.MessageBox.WARNING
                    });
                  },
                  method : 'GET',
                  params : {
                    id : id
                  }
                });
              }else{

              }
            });
            
          }
        })

        
        var newRoleFormPanel = new Ext.form.FormPanel({
          labelWidth: 45,
          width: 300,
          labelAlign: 'right',
          buttonAlign: 'center',
          frame : true,
          buttons: [clearTestDataButton]
        });
        newRoleFormPanel.render('clear_test_data');
      })
    </script>
    <div id="clear_test_data"></div>
  </body>
</html>